<?php
/**
 * Created by PhpStorm .
 * User: 杜磊磊
 * Date: 2020/7/2
 * Time: 18:49
 */
namespace app\common\lib;
class Str
{
    /**
     * 生成登录所需要的token
     * @param $string
     * @return string
     */
    public static function getLoginToken($string)
    {
        //生成token
        $str = md5(uniqid(md5(microtime(true)),true));//生成一个不会重复的字符串
        $token = sha1($str.$string);
        return $token;
    }
}